﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="Header.ascx.cs" Inherits="SBACN.WebSite.UC.Header" %>
<script type="text/javascript" src="../Scripts/common.js"></script>
<script type="text/javascript">
	function DoSearch() {
		var searchPage = "<%= SearchPageUrl%>";
		var keyword = $jqy.trim($jqy("#keywords").val());
		if (keyword.length > 0 && keyword != "请输入关键字") {
			if (searchPage.indexOf("?") > 1) {
				window.open(searchPage + "&q=" + escape(keyword));
			}
			else {
				window.open(searchPage + "?q=" + escape(keyword));
			}
		}
	}
	function DoLogout() {
		document.getElementById("<%= btn_Logout.ClientID%>").click();
	}
	function Search(sender) {
		if ($jqy.trim(sender.value) == "请输入关键字") {
			sender.value = "";
		}
	}
	function SearchBlur(sender) {
		if ($jqy.trim(sender.value) == "") {
			sender.value = "请输入关键字";
		}
	}
	function AddFav() {
		try {
			window.external.addfavorite(window.location.href, '上海市银行同业公会');
		}
		catch (e) {
			try {
				window.sidebar.addPanel("上海市银行同业公会", window.location.href, "");
			}
			catch (e) {
				alert("抱歉，您所使用的浏览器无法完成此操作。\n\n您可以使用‘Ctrl+D’快捷键添加收藏。");
			}
		}
		//window.external.addfavorite(window.location.href, '上海市银行同业公会')
	}
	function setHome(obj) {

		try {
			obj.style.behavior = 'url(#default#homepage)';
			obj.setHomePage(window.location.href);
		} catch (e) {
			if (window.netscape) {
				try {
					netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
				} catch (e) {
					alert("抱歉，此操作被浏览器拒绝！\n\n请在浏览器地址栏输入“about:config”并回车然后将[signed.applets.codebase_principal_support]设置为'true'");
				};
			} else {
				alert("抱歉，您所使用的浏览器无法完成此操作。\n\n您需要手动将'http://www.sbacn.org/'设置为首页。");
			};
		};

		//		if (document.all) {
		//			document.body.style.behavior = 'url(#default#homepage)';
		//			document.body.setHomePage(window.location.href);
		//		}
		//		else if (window.sidebar) {
		//			if (window.netscape) {
		//				try {
		//					netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
		//				}
		//				catch (e) {
		//					alert("该操作被浏览器拒绝，如果想启用该功能，请在地址栏内输入 about:config,然后将项 signed.applets.codebase_principal_support 值该为true");
		//				}
		//			}
		//			var prefs = Components.classes['@mozilla.org/preferences-service;1'].getService(Components.interfaces.nsIPrefBranch);
		//			prefs.setCharPref('browser.startup.homepage', window.location.href);
		//		}
	}
	function Searchkeyup(e) {
		e = window.event || e;
		var key = e.keyCode || e.which;
		if (key == 13) {
			DoSearch();
		}
	}
	var mainMenu = 0;
	var childCode = 0;
	function ShowMenu(sender) {
		if ($jqy(sender)) {
			$jqy(sender).addClass("over");
		}
	}

	function HideMenu(sender) {
		if ($jqy(sender)) {
			$jqy(sender).removeClass('over');
		}
	}
</script>
<div id="header">
	<div class="logo">
		<img src="/images/logo20.png" alt="" /></div>
	<div id="headerright">
		<div id="headlink">
			<asp:Label ID="lbl_LogInfo" runat="server"><a href="/Login.aspx">登录</a>&nbsp;</asp:Label>|&nbsp;<a
				href="javascript:void(0);" onclick="setHome(this)">设为首页</a>&nbsp;|&nbsp;<a href="javascript:AddFav();">收藏本页</a>&nbsp;|&nbsp;<a
					href="<%= WebMapUrl%>?st=00100003" target="_blank">网站地图</a>&nbsp;|&nbsp;<a href="/En/Index.aspx">English</a></div>
		<div id="search">
			<label class="textbox-l">
			</label>
			<label class="textbox">
				<input name="keywords" type="text" onkeyup="return Searchkeyup(event);" onclick="return Search(this);"
					onblur="return SearchBlur(this);" id="keywords" value="请输入关键字" maxlength="50" />
			</label>
			<label id="searchBtn" class="textbox-r" style="cursor: pointer;" onclick="return DoSearch();">
			</label>
		</div>
	</div>
</div>
<div style="display: none;">
	<asp:Button Text="" runat="server" ID="btn_Logout" OnClick="btn_Logout_Click" />
	<asp:Button Text="" runat="server" ID="btn_Disable" OnClientClick="return false;" />
</div>
<!--菜单开始-->
<div id="nv" runat="server" clientidmode="Static">
</div>
<!--菜单结束-->
<div id="mu" class="cl">
	<%= HeaderMenuHtml%>
</div>
